class LenError(Exception):
    def __str__(self):
        return '输入的长度不符合规定'

class InfoError(Exception):
    def __str__(self):
        return'输入内容不符合规定'


username =input('请输入用户名:')
try:
    if len(username)>=8 and len(username)<=16:
        print('长度符合规定')
    else:
        raise LenError
except LenError as e:
    print(e)
